load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "loqrecovery",
    srcs = [
        "apply.go",
        "collect.go",
        "marshalling.go",
        "plan.go",
        "record.go",
        "server.go",
        "store.go",
        "testing_knobs.go",
        "utils.go",
        "version.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/loqrecovery",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/base",
        "//pkg/clusterversion",
        "//pkg/gossip",
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver",
        "//pkg/kv/kvserver/kvserverpb",
        "//pkg/kv/kvserver/kvstorage",
        "//pkg/kv/kvserver/liveness",
        "//pkg/kv/kvserver/liveness/livenesspb",
        "//pkg/kv/kvserver/loqrecovery/loqrecoverypb",
        "//pkg/kv/kvserver/raftlog",
        "//pkg/kv/kvserver/stateloader",
        "//pkg/raft/raftpb",
        "//pkg/roachpb",
        "//pkg/rpc",
        "//pkg/server/serverpb",
        "//pkg/settings/cluster",
        "//pkg/storage",
        "//pkg/storage/fs",
        "//pkg/util/grpcutil",
        "//pkg/util/hlc",
        "//pkg/util/iterutil",
        "//pkg/util/log",
        "//pkg/util/protoutil",
        "//pkg/util/retry",
        "//pkg/util/strutil",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "//pkg/util/uuid",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_pebble//vfs",
        "@com_github_cockroachdb_redact//:redact",
        "@org_golang_google_grpc//:go_default_library",
        "@org_golang_x_sync//errgroup",
    ],
)

go_test(
    name = "loqrecovery_test",
    srcs = [
        "apply_test.go",
        "collect_raft_log_test.go",
        "collect_test.go",
        "main_test.go",
        "marshalling_test.go",
        "plan_test.go",
        "record_test.go",
        "recovery_env_test.go",
        "recovery_test.go",
        "server_integration_test.go",
        "server_test.go",
        "store_test.go",
        "version_test.go",
    ],
    data = glob(["testdata/**"]),
    embed = [":loqrecovery"],
    exec_properties = select({
        "//build/toolchains:is_heavy": {"test.Pool": "large"},
        "//conditions:default": {"test.Pool": "default"},
    }),
    deps = [
        "//pkg/base",
        "//pkg/clusterversion",
        "//pkg/keys",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver",
        "//pkg/kv/kvserver/kvserverbase",
        "//pkg/kv/kvserver/kvserverpb",
        "//pkg/kv/kvserver/kvstorage",
        "//pkg/kv/kvserver/loqrecovery/loqrecoverypb",
        "//pkg/kv/kvserver/raftlog",
        "//pkg/kv/kvserver/stateloader",
        "//pkg/raft/raftpb",
        "//pkg/roachpb",
        "//pkg/rpc",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/server",
        "//pkg/server/serverpb",
        "//pkg/settings/cluster",
        "//pkg/spanconfig",
        "//pkg/storage",
        "//pkg/storage/enginepb",
        "//pkg/storage/fs",
        "//pkg/testutils",
        "//pkg/testutils/datapathutils",
        "//pkg/testutils/listenerutil",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/skip",
        "//pkg/testutils/testcluster",
        "//pkg/util/hlc",
        "//pkg/util/keysutil",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/protoutil",
        "//pkg/util/randutil",
        "//pkg/util/stop",
        "//pkg/util/strutil",
        "//pkg/util/timeutil",
        "//pkg/util/uuid",
        "@com_github_cockroachdb_datadriven//:datadriven",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_pebble//vfs",
        "@com_github_stretchr_testify//require",
        "@in_gopkg_yaml_v2//:yaml_v2",
    ],
)
